package cn.iune.erp.invoice;

import java.math.BigDecimal;
import java.sql.Date;
import java.text.ParseException;
import java.util.List;

import com.alibaba.fastjson.JSONObject;

import cn.iune.common.base.IBizDataIface;

public interface IAccountInvoiceService extends IBizDataIface {

	public void insert(AccountInvoice a);
	
	public void update(AccountInvoice a);

	public void delete(String fID);


	AccountInvoice getByID(String fID);

	AccountInvoice getByNo(String accountInvoiceNo, String enterpriseNo);

	int confirm(String fID);

	int confirm(AccountInvoice a);

	int active(String fID);

	int active(AccountInvoice a);

	int open(String fID);

	int open(AccountInvoice a);

	int close(String fID);

	int close(AccountInvoice a);

	int unAgree(AccountInvoice a);

	int unAgree(String fID);

	int updateMaxDetailNo(String fID, int maxDetailNo);

	int updateMaxDetailNo(String accountInvoiceNo, String billType, String enterpriseNo, int maxDetailNo);

	int updateAllAmount(String fID, BigDecimal itemAmount, BigDecimal orderAmount, BigDecimal orderAmountOld,
			BigDecimal orderAmountTax, BigDecimal orderAmountTotal, BigDecimal accountAmountOld,
			BigDecimal accountAmountTax, BigDecimal accountAmountTotal

	);


	int agreeIt(AccountInvoice a, String cUsercode, String cUsername, String userId);

	int agreeIt(String fID, String cUsercode, String cUsername, String userId);


//	int updateNextNo(String accountInvoiceNo, String enterpriseNo, String autoPayment, String next, String nextName,
//			String nextNo, String settleCategory, String settleCategoryLabel);


	JSONObject save(JSONObject object) throws ParseException;

	JSONObject newDataDetail(JSONObject param);

	JSONObject queryDataDetail(JSONObject param);

	JSONObject saveDetail(JSONObject object) throws ParseException;


	AccountInvoice packing(String cUsercode, String cUsername, String userId, String enterpriseNo,
			String enterpriseName);

	AccountInvoice packing(String billType, String billTypeName, String systemCode, int flowType, String revOpay,
			int direction, String autoCode, String origin, String originName, String billNo, String cUsercode,
			String cUsername, String userId, String employeeNo, String employeeName, String enterpriseNo,
			String enterpriseName);


	AccountInvoice getByNextNo(String next, String nextNo, String enterpriseNo);

	BigDecimal getReceiveAmountTotay(List<Object> params);

	BigDecimal getPayableAmountTotay(List<Object> params);

	int orderAmountClearedSub(String accountInvoiceNo, String enterpriseNo, BigDecimal orderAmountCleared,
			BigDecimal discountCash);

	int orderAmountClearedAdd(String accountInvoiceNo, String enterpriseNo, BigDecimal orderAmountCleared,
			BigDecimal discountCash);

	AccountInvoice updateSettleCategory(String fID, String settleCategory, String settleCategoryLabel);

	AccountInvoice accountInvoiceDSYFInsert(String serialNumber, String origin, String originName, String originNo,
			String dealObject, String dealObjectLabel, String customerID, String customerNo, String shortName,
			String customerName, BigDecimal orderAmount, String settleCategory, String settleCategoryLabel,
			String orderNo, String projectNo, String cUsercode, String cUsername, String userId, String employeeNo,
			String employeeName, String enterpriseNo, String enterpriseName);

	AccountInvoice getQTYSByOriginNo(String origin, String originNo, String enterpriseNo);

	List<AccountInvoice> getUnclearYSZKList(String guestNumber, String enterpriseNo);

	JSONObject jointData(JSONObject param);

	List<AccountInvoice> getAccountList(String revOpay, Date dateStart, Date dateEnd, String enterpriseNo);

	List<AccountInvoice> getAccountList(String revOpay, String customerID, Date dateStart, Date dateEnd,
			String enterpriseNo);






}